from sklearn.preprocessing import StandardScaler
import numpy as np
temp = np.array([1,2,4,6,3,8,10])
temp = temp.reshape(-1,1)
scaler = StandardScaler()
# Compute the mean and std to be used for later scaling 计算均值和标准差
scaler.fit(temp)

print(scaler.mean_)
# 方差
print(scaler.scale_)
# 标准差
print(scaler.var_)
# 标准归一化
print(scaler.transform(temp))

data = np.array([1,52,324,57,123,462,5001])
data=data.reshape(-1,1)
scaler.fit(data)
print(scaler.mean_)
# 方差
print(scaler.scale_)
# 标准差
print(scaler.var_)
# 标准归一化
print(scaler.transform(data))